package com.module.app.network

import com.module.frame.retrofit.BaseResponse

const val SUCCESS_CODE = 0
const val ERROR_CODE = -9999

/**
 * 作者　: yanxuwen
 * 时间　: 2022/9/20
 * 描述　: 服务器返回数据的基类
 * 具体根据公司的规则来定义
 */
data class MyBaseResponse<T>(
    private val code: Int,
    private val msg: String,
    private var data: T?
) : BaseResponse<T> {
    override fun getCode(): Int {
        return code
    }

    override fun getMsg(): String? {
        return msg
    }

    override fun getData(): T? {
        return data
    }

    override fun isSuccess(): Boolean {
        return code == SUCCESS_CODE
    }


}